<nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
<form nz-form *ngIf="!isLoading" [formGroup]="validateForm" (ngSubmit)="submitForm(3,1)">
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzFor="cusName">申请人</nz-form-label>
    <nz-form-control [nzSpan]="20" [nzValidateStatus]="validateForm.controls['cusName']">
      <input type="text" nz-input formControlName="cusName" placeholder="申请人" readonly>
      <nz-form-explain *ngIf="validateForm.get('cusName').dirty && validateForm.get('cusName').hasError('required')">请输入申请人</nz-form-explain>
      <nz-form-explain *ngIf="validateForm.get('cusName').dirty && validateForm.get('cusName').hasError('maxlength')">不能超过30个字</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzFor="withdrawPrice">提现金额</nz-form-label>
    <nz-form-control [nzSpan]="20">
      <input type="text" nz-input formControlName="withdrawPrice" placeholder="提现金额" readonly>
      <nz-form-explain *ngIf="validateForm.get('withdrawPrice').dirty && validateForm.get('withdrawPrice').hasError('required')">请输入提现金额</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzFor="status">当前状态</nz-form-label>
    <nz-form-control [nzSpan]="20" [nzValidateStatus]="validateForm.controls['status']">
      <nz-select formControlName="status" [nzPlaceHolder]="'当前状态'" [nzDisabled]="true">
        <nz-option
          *ngFor="let option of statusOption"
          [nzLabel]="option.value"
          [nzValue]="option.key">
        </nz-option>
      </nz-select>
      <nz-form-explain *ngIf="validateForm.get('status').dirty && validateForm.get('status').hasError('required')">请选择当前状态</nz-form-explain>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="4" nzFor="auditingReason">审核备注</nz-form-label>
    <nz-form-control [nzSpan]="20" [nzValidateStatus]="validateForm.controls['auditingReason']">
      <textarea rows="5" nz-input formControlName="auditingReason" placeholder="审核备注"></textarea>
      <nz-form-explain *ngIf="validateForm.get('auditingReason').dirty && validateForm.get('auditingReason').hasError('required')">请输入审核备注</nz-form-explain>
      <nz-form-explain *ngIf="validateForm.get('auditingReason').dirty && validateForm.get('auditingReason').hasError('maxlength')">不能超过200个字</nz-form-explain>
      <nz-form-extra style="color: orange;" *ngIf="entity.status == 1">
        温馨提示：<br/>
        1.选择通过线下支付方式，即表示您已通过线下操作将提现金额发放给申请用户<br/>
        2.选择通过线上支付方式，即表示将通过程序给申请用户发放提现金额<br/>
        3.选择驳回，即表示申请不符合要求，此时审核备注必填
      </nz-form-extra>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item *ngIf="entity.errCodeDes && entity.status == 2">
    <nz-form-label [nzSpan]="4">线上发放失败</nz-form-label>
    <nz-form-control [nzSpan]="20">
      <nz-form-extra style="color: orange;">
        {{entity.errCodeDes}}
        <nz-popconfirm [nzTitle]="'将通过程序线上给申请用户补发提现金额，确认吗？'" (nzOnConfirm)="reSend()">
          <button nz-button type="button" style="margin-left: 8px;" [nzType]="'primary'" nz-popconfirm >补发</button>
        </nz-popconfirm>
      </nz-form-extra>
    </nz-form-control>
  </nz-form-item>
</form>
<div class="modal-footer">
  <button nz-button type="button" (click)="close()">关闭</button>
  <span *ngIf="entity.status == 1">
    <nz-popconfirm [nzTitle]="'确定审核通过用户提现申请，并已线下发放提现金额给申请用户吗？'" (nzOnConfirm)="submitForm(2,1)">
      <button nz-button type="button" style="margin-left: 8px;" [nzType]="'primary'" nz-popconfirm >通过（线下支付）</button>
    </nz-popconfirm>
    <nz-popconfirm [nzTitle]="'确定审核通过用户提现申请，并通过程序线上给申请用户发放提现金额吗？'" (nzOnConfirm)="submitForm(2,2)">
      <button nz-button type="button" style="margin-left: 8px;" *ngIf="entity.canPayOnline" [nzType]="'primary'" nz-popconfirm >通过（线上支付）</button>
    </nz-popconfirm>
    <nz-popconfirm [nzTitle]="'确定要驳回用户提现申请吗？'" (nzOnConfirm)="submitForm(3,1)">
      <button nz-button type="button" style="margin-left: 8px;" [nzType]="'danger'" nz-popconfirm >驳回</button>
    </nz-popconfirm>
  </span>
</div>
